#!/bin/sh
# This script is used within the Draco installer to present
# a package series selection menu.  If not present, a default list
# built into the installer is used.

# Protected tmp directory:
TMP=/var/log/setup/tmp
if [ ! -d $TMP ]; then
  mkdir -p $TMP
fi

rm -f $TMP/SeTSERIES
dialog --title "PACKAGE SERIES SELECTION" --item-help --checklist \
"Now it's time to select which general categories of software to install \
on your system.  Use the spacebar to select or unselect the software you \
wish to install.  You can use the up and down arrows to see all the \
possible choices.  Recommended choices have been preselected.  Press the \
ENTER key when you are finished." \
20 75 9 \
"system" "DracoLinux" on "DracoLinux System 0.4.x." \
"linux26" "Linux v2.6" on "Default Linux kernel 2.6.32." \
"linux30" "Linux v3.0" off "Alternative Linux kernel 3.0.x." \
"pkgsrc" "pkgsrc" off "Latest stable pkgsrc framework." \
2> $TMP/SeTSERIES
if [ ! $? = 0 ]; then
  rm -f $TMP/SeTSERIES
  exit
fi

# Rewrite the list into a single # delimited line:
INSTSETS="`cat $TMP/SeTSERIES | tr -d " "`"
INSTSETS="`echo $INSTSETS | tr "\042" "#" `"
INSTSETS="`echo $INSTSETS | tr "," "#" `"
# Store the selection list:
echo "$INSTSETS" > $TMP/SeTSERIES
